package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

// 浏览器打开 http://localhost:8080/hello?name=zhangsan
func main() {
	r := gin.Default()

	r.Use(gin.Logger())
	r.Use(gin.Recovery())

	r.GET("/hello", func(c *gin.Context) {
		name := c.Query("name")
		c.JSON(http.StatusOK, gin.H{"message": "Hello, " + name})
	})

	r.Run(":8080")
}
